package com.example.ex2;

import org.springframework.core.env.Environment;
import org.springframework.boot.CommandLineRunner;

import java.util.Objects;
@SuppressWarnings("unused")
public class CommandLineRunnerTest implements CommandLineRunner {
    Environment env;
    public CommandLineRunnerTest(Environment env)
    {
        this.env = env;
    }
    @Override
    public void run(String... args) throws Exception {
        System.out.println("随机字符串：".concat(Objects.requireNonNull(env.getProperty("random."))));
    }
}
